<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3">
        <span class="font-bold" translate="aside.nav.process.patcase"
              ng-if="isPatcase = '/patcase' === $state.current.url"></span>
        <span class="font-bold" translate="aside.nav.process.filter"
              ng-if="isFilter = '/filter' === $state.current.url"></span>
    </h1>
</div>

<div ng-class="isSmart?'':'wrapper-md'" class="remove-wrapper">
    <div class="panel panel-default">
        <div ng-controller="PatientIndexCtrl">
            <div class="btn-group wrapper-sm">
                <div ng-show="isPatcase">
                    <div class="input-group" ng-class="isSmart?'col-xs-12':''">
                        <!--<input type="text" class="form-control" ng-model="$parent.like"-->
                               <!--placeholder="{{ (selectLang == 'English') ? 'enter keywords' : '\u8bf7\u8f93\u5165\u5173\u952e\u5b57' }}">-->
                        <!--<span class="input-group-btn">-->
                            <!--<button class="btn btn-success" ng-click="$parent.filterStatus='all'"><span-->
                                    <!--translate="business.navtitle.search_patient"></span></button>-->
                        <!--</span>-->
                        <input type="text" class="form-control" ng-model="like"
                               placeholder="{{ (selectLang == 'English') ? 'enter keywords' : '\u8bf7\u8f93\u5165\u5173\u952e\u5b57' }}">
                        <span class="input-group-btn">
                            <button class="btn btn-success" ng-click="filtlike()"><span
                                    translate="business.navtitle.search_patient"></span></button>
                        </span>
                    </div>
                </div>
            </div>
            <table class="table table-striped" style="width:100%" dt-disable-deep-watchers="true" ui-options="dtOptions"
                   ui-jq="dataTable">
                <thead>
                <tr class="row">
                    <th ng-class="isSmart?'col-xs-4':''" translate="business.patcase.id"></th>
                    <th class="" translate="common.updated" ng-if="!isSmart"></th>
                    <th ng-class="isSmart?'col-xs-4':''" translate="common.name"></th>
                    <th class="" translate="user.gender" ng-if="!isSmart"></th>
                    <th class="" translate="user.mobilephone" ng-if="!isSmart"></th>
                    <th class="" translate="business.patcase.countOfPatCase" ng-if="!isSmart"></th>
                    <th ng-class="isSmart?'col-xs-4':'col-xs-4 col-md-3'" translate="common.operate"></th>
                </tr>
                </thead>
                <tbody>
                <tr class="row" ng-repeat="model in patients">
                    <td class="">P-{{ model.patient_Id }}</td>
                    <td class="" ng-if="!isSmart">{{ moment(model.updated).format("YYYY-MM-DD") }}</td>
                    <td class="">{{ model._user.realName }}</td>
                    <td class="" ng-if="!isSmart">
                            <span ng-show="model._user.gender != null"
                                  translate="{{'user.gender.' + model._user.gender}}">
                            </span>
                    </td>
                    <td class="" ng-if="!isSmart">{{ model._user.mobile_Phone }}</td>
                    <td class="" ng-if="!isSmart">
                        {{ model.patCase_Count}}
                    </td>
                    <td>
                        <span ng-if="isPatcase" class="nowrap-remove">
                            <button type="button" class="btn btn-sm btn-info font-bold"
                                    title="{{ 'common.details' | translate }}"
                                    translate="common.details"
                                    ng-click="open({ templateUrl: 'views/work/basic_servreq_flow.html?tmp=2' }, model)">
                            </button>
                            <button type="button" class="btn btn-sm btn-warning font-bold"
                                    title="{{ 'common.edit' | translate }}"
                                    translate="common.edit"
                                    ng-click="open({ templateUrl: 'editPatient.html' }, model.patient_Id)">
                            </button>
                            <div class="btn-group">
                                <button type="button" class="btn btn-sm btn-primary font-bold dropdown-toggle"
                                        data-toggle="dropdown"
                                        title="{{ 'common.application' | translate }}"
                                        translate="common.application">
                                    <span class="caret"></span>
                                </button>
                                <ul class="dropdown-menu dropdown-menu-fix">
                                    <li class="text-center">
                                        <a ui-sref="app.process.serviceCreate({ service_Id:2, patient_Id: model.patient_Id })">
                                            <span class="font-bold" translate="aside.nav.process.scheme">scheme</span>
                                        </a>
                                    </li>
                                    <li class="text-center">
                                        <a ui-sref="app.process.serviceCreate({ service_Id:3, patient_Id: model.patient_Id})">
                                            <span class="font-bold"
                                                  translate="aside.nav.process.screenage">screenage</span>
                                        </a>
                                    </li>
                                    <li class="text-center">
                                        <a ui-sref="app.process.serviceCreate({ service_Id:5, patient_Id: model.patient_Id })">
                                            <span class="font-bold" translate="aside.nav.process.appointment">appointment</span>
                                        </a>
                                    </li>
                                </ul>
                            </div>
                        </span>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
    </div>
</div>
<div ng-include="'views/work/templates.html'"></div>